package com.ytjj.qmyx.admin.mapper;

import com.ytjj.qmyx.admin.model.*;
import com.ytjj.qmyx.admin.model.request.AdminRequest;
import com.ytjj.qmyx.mall.model.MenuApi;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

public interface AdminMapper {
    long countByExample(AdminExample example);

    int deleteByExample(AdminExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Admin record);

    int insertSelective(Admin record);

    List<Admin> selectByExample(AdminExample example);

    Admin selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);

    List<Role> getRoleByTel(String tel);

    List<Role> getRoleByEmail(String email);

    int checkAdmined(String email);

    int checkBankerChildren(String tel,Integer bankerId);

    int checkBankered(String tel);

    int checkBankerName(String tel);

    List<Menu> getMenuAllByTel(String tel);

    List<Admin> selectList(AdminRequest adminRequest);

    List<MenuApi> getMenuApiByRoleId(@Param("roleId") Integer roleId);

    List<String> getApiCodeList(@Param("roleId") Integer roleId);

    int adminId(String email);

    int deleteAdmin(Integer id);

    int addAdminRole(Integer roleId, Integer adminId);

    int selectAdmin(String compellation);

    int updateAdminRole(Integer adminId,Integer roleId);

    int updateStatusById(Integer id,Integer status);

    int selectAdmins(@Param("compellation") String compellation);

    void updateStatusByIds(@Param("adminIds")List<Integer> adminIds,@Param("status") int status);

    List<Integer> selectAdminsByTel(String tel);

    List<Integer> checkAdminedByEmail(String email);

    List<Integer> selectAdminsByCompellation(String compellation);

    int findRoleAdminById(Integer id);

    String selectByEmail(String userId);

    int insertNote(YxOrderExceptionNote yxOrderExceptionNote);

    /**
     * 根据条件查询账号
     */
    List<Admin> getAllAdmin(Admin admin);

    /**
     * 查询所有角色下的账号
     */
    List<Admin> getAllRoleAdmin(@Param("roleCode") String roleCode);

    /**
     * 根据账号查询账号
     * @param name
     * @return
     */
    List<Admin> getAdminByName(@Param("name")String name);
}